package com.software.loginregister.databasesHelper;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;
import com.software.loginregister.entity.User;

@Dao
public interface UserDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(User user);

    @Update
    void update(User user);

    @Query("SELECT * FROM users WHERE userId = :userId")
    User getUserById(Long userId);

    @Query("DELETE FROM users WHERE userId = :userId")
    void deleteUser(Long userId);

    @Query("DELETE FROM users")
    void deleteAll();
}
